package hottargui.domain.gamma;

import hottargui.domain.*;

public class GammaAfterDieRollActionStrategyImpl implements AfterDieRollActionStrategy {

	private StateMachine _sm;
	private ShuffleStrategy _shuffleStrategy;
	private DeckOfCards _deck;
	
	public GammaAfterDieRollActionStrategyImpl(StateMachine sm, ShuffleStrategy shuffleStrategy) {
		_sm = sm;
		_shuffleStrategy = shuffleStrategy; 
	}

	public boolean doFollowUpOnRollAction(int diceFaceValue) {
		this.createNewDeckOfCards(diceFaceValue);		
		return false;
	}


	public void createNewDeckOfCards(int i) {
		DeckOfCards deck = new GammaDeckOfCardsImpl(i, _shuffleStrategy);
		deck.shuffle();
		//System.out.println("nr. crads in deck " + deck.getNumberOfTribeCards(PlayerColor.Blue));

		   registrerNewDeckOfCards(deck);
		   _sm.setState(State.endRound, false);
	}

	private void registrerNewDeckOfCards(DeckOfCards deck) {
		_sm.setDeckOfCards(deck);
	}


	public DeckOfCards getDeckOfCards() {
		return _deck;
	}


}
